
/*
===============================================================================
                    EntitySpaces Studio by EntitySpaces, LLC
             Persistence Layer and Business Objects for Microsoft .NET
             EntitySpaces(TM) is a legal trademark of EntitySpaces, LLC
                          http://www.entityspaces.net
===============================================================================
EntitySpaces Version : 2012.1.0930.0
EntitySpaces Driver  : SQL
Date Generated       : 2016/7/28 12:53:20
===============================================================================
*/

using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Text;
using System.Linq;
using System.Data;
using System.ComponentModel;
using System.Xml.Serialization;
using System.Runtime.Serialization;

using EntitySpaces.Core;
using EntitySpaces.Interfaces;
using EntitySpaces.DynamicQuery;



namespace yncTech.BusinessObjects
{
	/// <summary>
	/// Encapsulates the 'V_BoxLabelInfo' view
	/// </summary>

    [DebuggerDisplay("Data = {Debug}")]
	[Serializable]
	[DataContract]
	[KnownType(typeof(VBoxLabelInfo))]	
	[XmlType("VBoxLabelInfo")]
	public partial class VBoxLabelInfo : esVBoxLabelInfo
	{	
		[DebuggerBrowsable(DebuggerBrowsableState.RootHidden | DebuggerBrowsableState.Never)]
		protected override esEntityDebuggerView[] Debug
		{
			get { return base.Debug; }
		}

		override public esEntity CreateInstance()
		{
			return new VBoxLabelInfo();
		}
		
		#region Static Quick Access Methods
		
		#endregion

		
					
		
	
	}



    [DebuggerDisplay("Count = {Count}")]
	[Serializable]
	[CollectionDataContract]
	[XmlType("VBoxLabelInfoCollection")]
	public partial class VBoxLabelInfoCollection : esVBoxLabelInfoCollection, IEnumerable<VBoxLabelInfo>
	{

		
		
		#region WCF Service Class
		
		[DataContract]
		[KnownType(typeof(VBoxLabelInfo))]
		public class VBoxLabelInfoCollectionWCFPacket : esCollectionWCFPacket<VBoxLabelInfoCollection>
		{
			public static implicit operator VBoxLabelInfoCollection(VBoxLabelInfoCollectionWCFPacket packet)
			{
				return packet.Collection;
			}

			public static implicit operator VBoxLabelInfoCollectionWCFPacket(VBoxLabelInfoCollection collection)
			{
				return new VBoxLabelInfoCollectionWCFPacket() { Collection = collection };
			}
		}
		
		#endregion
		
				
	}



    [DebuggerDisplay("Query = {Parse()}")]
	[Serializable]	
	public partial class VBoxLabelInfoQuery : esVBoxLabelInfoQuery
	{
		public VBoxLabelInfoQuery():this("VBoxLabelInfoQuery")
		{
		}
		public VBoxLabelInfoQuery(string joinAlias)
		{
			this.es.JoinAlias = joinAlias;
		}	

		override protected string GetQueryName()
		{
			return "VBoxLabelInfoQuery";
		}
		
					
	
		#region Explicit Casts
		
		public static explicit operator string(VBoxLabelInfoQuery query)
		{
			return VBoxLabelInfoQuery.SerializeHelper.ToXml(query);
		}

		public static explicit operator VBoxLabelInfoQuery(string query)
		{
			return (VBoxLabelInfoQuery)VBoxLabelInfoQuery.SerializeHelper.FromXml(query, typeof(VBoxLabelInfoQuery));
		}
		
		#endregion		
	}

	[DataContract]
	[Serializable]
	abstract public partial class esVBoxLabelInfo : esEntity
	{
		public esVBoxLabelInfo()
		{

		}
		
		#region LoadByPrimaryKey
		
		#endregion
		
		#region Properties
		
		
		
		/// <summary>
		/// Maps to V_BoxLabelInfo.BoxNo
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.String BoxNo
		{
			get
			{
				return base.GetSystemString(VBoxLabelInfoMetadata.ColumnNames.BoxNo);
			}
			
			set
			{
				if(base.SetSystemString(VBoxLabelInfoMetadata.ColumnNames.BoxNo, value))
				{
					OnPropertyChanged(VBoxLabelInfoMetadata.PropertyNames.BoxNo);
				}
			}
		}		
		
		/// <summary>
		/// Maps to V_BoxLabelInfo.BoxYear
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.Int32? BoxYear
		{
			get
			{
				return base.GetSystemInt32(VBoxLabelInfoMetadata.ColumnNames.BoxYear);
			}
			
			set
			{
				if(base.SetSystemInt32(VBoxLabelInfoMetadata.ColumnNames.BoxYear, value))
				{
					OnPropertyChanged(VBoxLabelInfoMetadata.PropertyNames.BoxYear);
				}
			}
		}		
		
		/// <summary>
		/// Maps to V_BoxLabelInfo.BoxMonth
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.Int32? BoxMonth
		{
			get
			{
				return base.GetSystemInt32(VBoxLabelInfoMetadata.ColumnNames.BoxMonth);
			}
			
			set
			{
				if(base.SetSystemInt32(VBoxLabelInfoMetadata.ColumnNames.BoxMonth, value))
				{
					OnPropertyChanged(VBoxLabelInfoMetadata.PropertyNames.BoxMonth);
				}
			}
		}		
		
		/// <summary>
		/// Maps to V_BoxLabelInfo.Dept
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.String Dept
		{
			get
			{
				return base.GetSystemString(VBoxLabelInfoMetadata.ColumnNames.Dept);
			}
			
			set
			{
				if(base.SetSystemString(VBoxLabelInfoMetadata.ColumnNames.Dept, value))
				{
					OnPropertyChanged(VBoxLabelInfoMetadata.PropertyNames.Dept);
				}
			}
		}		
		
		/// <summary>
		/// Maps to V_BoxLabelInfo.LegalEntity
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.String LegalEntity
		{
			get
			{
				return base.GetSystemString(VBoxLabelInfoMetadata.ColumnNames.LegalEntity);
			}
			
			set
			{
				if(base.SetSystemString(VBoxLabelInfoMetadata.ColumnNames.LegalEntity, value))
				{
					OnPropertyChanged(VBoxLabelInfoMetadata.PropertyNames.LegalEntity);
				}
			}
		}		
		
		/// <summary>
		/// Maps to V_BoxLabelInfo.DocType
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.String DocType
		{
			get
			{
				return base.GetSystemString(VBoxLabelInfoMetadata.ColumnNames.DocType);
			}
			
			set
			{
				if(base.SetSystemString(VBoxLabelInfoMetadata.ColumnNames.DocType, value))
				{
					OnPropertyChanged(VBoxLabelInfoMetadata.PropertyNames.DocType);
				}
			}
		}		
		
		/// <summary>
		/// Maps to V_BoxLabelInfo.BoxID
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.Decimal? BoxID
		{
			get
			{
				return base.GetSystemDecimal(VBoxLabelInfoMetadata.ColumnNames.BoxID);
			}
			
			set
			{
				if(base.SetSystemDecimal(VBoxLabelInfoMetadata.ColumnNames.BoxID, value))
				{
					OnPropertyChanged(VBoxLabelInfoMetadata.PropertyNames.BoxID);
				}
			}
		}		
		
		/// <summary>
		/// Maps to V_BoxLabelInfo.DocNoMax
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.String DocNoMax
		{
			get
			{
				return base.GetSystemString(VBoxLabelInfoMetadata.ColumnNames.DocNoMax);
			}
			
			set
			{
				if(base.SetSystemString(VBoxLabelInfoMetadata.ColumnNames.DocNoMax, value))
				{
					OnPropertyChanged(VBoxLabelInfoMetadata.PropertyNames.DocNoMax);
				}
			}
		}		
		
		/// <summary>
		/// Maps to V_BoxLabelInfo.DocNoMin
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.String DocNoMin
		{
			get
			{
				return base.GetSystemString(VBoxLabelInfoMetadata.ColumnNames.DocNoMin);
			}
			
			set
			{
				if(base.SetSystemString(VBoxLabelInfoMetadata.ColumnNames.DocNoMin, value))
				{
					OnPropertyChanged(VBoxLabelInfoMetadata.PropertyNames.DocNoMin);
				}
			}
		}		
		
		/// <summary>
		/// Maps to V_BoxLabelInfo.PostDate
		/// </summary>
		[DataMember(EmitDefaultValue=false)]
		virtual public System.DateTime? PostDate
		{
			get
			{
				return base.GetSystemDateTime(VBoxLabelInfoMetadata.ColumnNames.PostDate);
			}
			
			set
			{
				if(base.SetSystemDateTime(VBoxLabelInfoMetadata.ColumnNames.PostDate, value))
				{
					OnPropertyChanged(VBoxLabelInfoMetadata.PropertyNames.PostDate);
				}
			}
		}		
		
		#endregion	

		#region .str() Properties
		
		public override void SetProperties(IDictionary values)
		{
			foreach (string propertyName in values.Keys)
			{
				this.SetProperty(propertyName, values[propertyName]);
			}
		}
		
		public override void SetProperty(string name, object value)
		{
			esColumnMetadata col = this.Meta.Columns.FindByPropertyName(name);
			if (col != null)
			{
				if(value == null || value is System.String)
				{				
					// Use the strongly typed property
					switch (name)
					{							
						case "BoxNo": this.str().BoxNo = (string)value; break;							
						case "BoxYear": this.str().BoxYear = (string)value; break;							
						case "BoxMonth": this.str().BoxMonth = (string)value; break;							
						case "Dept": this.str().Dept = (string)value; break;							
						case "LegalEntity": this.str().LegalEntity = (string)value; break;							
						case "DocType": this.str().DocType = (string)value; break;							
						case "BoxID": this.str().BoxID = (string)value; break;							
						case "DocNoMax": this.str().DocNoMax = (string)value; break;							
						case "DocNoMin": this.str().DocNoMin = (string)value; break;							
						case "PostDate": this.str().PostDate = (string)value; break;
					}
				}
				else
				{
					switch (name)
					{	
						case "BoxYear":
						
							if (value == null || value is System.Int32)
								this.BoxYear = (System.Int32?)value;
								OnPropertyChanged(VBoxLabelInfoMetadata.PropertyNames.BoxYear);
							break;
						
						case "BoxMonth":
						
							if (value == null || value is System.Int32)
								this.BoxMonth = (System.Int32?)value;
								OnPropertyChanged(VBoxLabelInfoMetadata.PropertyNames.BoxMonth);
							break;
						
						case "BoxID":
						
							if (value == null || value is System.Decimal)
								this.BoxID = (System.Decimal?)value;
								OnPropertyChanged(VBoxLabelInfoMetadata.PropertyNames.BoxID);
							break;
						
						case "PostDate":
						
							if (value == null || value is System.DateTime)
								this.PostDate = (System.DateTime?)value;
								OnPropertyChanged(VBoxLabelInfoMetadata.PropertyNames.PostDate);
							break;
					

						default:
							break;
					}
				}
			}
            else if (this.ContainsColumn(name))
            {
                this.SetColumn(name, value);
            }
			else
			{
				throw new Exception("SetProperty Error: '" + name + "' not found");
			}
		}		

		public esStrings str()
		{
			if (esstrings == null)
			{
				esstrings = new esStrings(this);
			}
			return esstrings;
		}

		sealed public class esStrings
		{
			public esStrings(esVBoxLabelInfo entity)
			{
				this.entity = entity;
			}
			
	
			public System.String BoxNo
			{
				get
				{
					System.String data = entity.BoxNo;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.BoxNo = null;
					else entity.BoxNo = Convert.ToString(value);
				}
			}
				
			public System.String BoxYear
			{
				get
				{
					System.Int32? data = entity.BoxYear;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.BoxYear = null;
					else entity.BoxYear = Convert.ToInt32(value);
				}
			}
				
			public System.String BoxMonth
			{
				get
				{
					System.Int32? data = entity.BoxMonth;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.BoxMonth = null;
					else entity.BoxMonth = Convert.ToInt32(value);
				}
			}
				
			public System.String Dept
			{
				get
				{
					System.String data = entity.Dept;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.Dept = null;
					else entity.Dept = Convert.ToString(value);
				}
			}
				
			public System.String LegalEntity
			{
				get
				{
					System.String data = entity.LegalEntity;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.LegalEntity = null;
					else entity.LegalEntity = Convert.ToString(value);
				}
			}
				
			public System.String DocType
			{
				get
				{
					System.String data = entity.DocType;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.DocType = null;
					else entity.DocType = Convert.ToString(value);
				}
			}
				
			public System.String BoxID
			{
				get
				{
					System.Decimal? data = entity.BoxID;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.BoxID = null;
					else entity.BoxID = Convert.ToDecimal(value);
				}
			}
				
			public System.String DocNoMax
			{
				get
				{
					System.String data = entity.DocNoMax;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.DocNoMax = null;
					else entity.DocNoMax = Convert.ToString(value);
				}
			}
				
			public System.String DocNoMin
			{
				get
				{
					System.String data = entity.DocNoMin;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.DocNoMin = null;
					else entity.DocNoMin = Convert.ToString(value);
				}
			}
				
			public System.String PostDate
			{
				get
				{
					System.DateTime? data = entity.PostDate;
					return (data == null) ? String.Empty : Convert.ToString(data);
				}

				set
				{
					if (value == null || value.Length == 0) entity.PostDate = null;
					else entity.PostDate = Convert.ToDateTime(value);
				}
			}
			

			private esVBoxLabelInfo entity;
		}
		
		[NonSerialized]
		private esStrings esstrings;		
		
		#endregion
		
		#region Housekeeping methods

		override protected IMetadata Meta
		{
			get
			{
				return VBoxLabelInfoMetadata.Meta();
			}
		}

		#endregion		
		
		#region Query Logic

		public VBoxLabelInfoQuery Query
		{
			get
			{
				if (this.query == null)
				{
					this.query = new VBoxLabelInfoQuery();
					InitQuery(this.query);
				}

				return this.query;
			}
		}

		public bool Load(VBoxLabelInfoQuery query)
		{
			this.query = query;
			InitQuery(this.query);
			return this.Query.Load();
		}
		
		protected void InitQuery(VBoxLabelInfoQuery query)
		{
			query.OnLoadDelegate = this.OnQueryLoaded;
			
			if (!query.es2.HasConnection)
			{
				query.es2.Connection = ((IEntity)this).Connection;
			}			
		}

		#endregion
		
        [IgnoreDataMember]
		private VBoxLabelInfoQuery query;		
	}



	[Serializable]
	abstract public partial class esVBoxLabelInfoCollection : esEntityCollection<VBoxLabelInfo>
	{
		#region Housekeeping methods
		override protected IMetadata Meta
		{
			get
			{
				return VBoxLabelInfoMetadata.Meta();
			}
		}

		protected override string GetCollectionName()
		{
			return "VBoxLabelInfoCollection";
		}

		#endregion		
		
		#region Query Logic

	#if (!WindowsCE)
		[BrowsableAttribute(false)]
	#endif
		public VBoxLabelInfoQuery Query
		{
			get
			{
				if (this.query == null)
				{
					this.query = new VBoxLabelInfoQuery();
					InitQuery(this.query);
				}

				return this.query;
			}
		}

		public bool Load(VBoxLabelInfoQuery query)
		{
			this.query = query;
			InitQuery(this.query);
			return Query.Load();
		}

		override protected esDynamicQuery GetDynamicQuery()
		{
			if (this.query == null)
			{
				this.query = new VBoxLabelInfoQuery();
				this.InitQuery(query);
			}
			return this.query;
		}

		protected void InitQuery(VBoxLabelInfoQuery query)
		{
			query.OnLoadDelegate = this.OnQueryLoaded;
			
			if (!query.es2.HasConnection)
			{
				query.es2.Connection = ((IEntityCollection)this).Connection;
			}			
		}

		protected override void HookupQuery(esDynamicQuery query)
		{
			this.InitQuery((VBoxLabelInfoQuery)query);
		}

		#endregion
		
		private VBoxLabelInfoQuery query;
	}



	[Serializable]
	abstract public partial class esVBoxLabelInfoQuery : esDynamicQuery
	{
		override protected IMetadata Meta
		{
			get
			{
				return VBoxLabelInfoMetadata.Meta();
			}
		}	
		
		#region QueryItemFromName
		
        protected override esQueryItem QueryItemFromName(string name)
        {
            switch (name)
            {
				case "BoxNo": return this.BoxNo;
				case "BoxYear": return this.BoxYear;
				case "BoxMonth": return this.BoxMonth;
				case "Dept": return this.Dept;
				case "LegalEntity": return this.LegalEntity;
				case "DocType": return this.DocType;
				case "BoxID": return this.BoxID;
				case "DocNoMax": return this.DocNoMax;
				case "DocNoMin": return this.DocNoMin;
				case "PostDate": return this.PostDate;

                default: return null;
            }
        }		
		
		#endregion
		
		#region esQueryItems

		public esQueryItem BoxNo
		{
			get { return new esQueryItem(this, VBoxLabelInfoMetadata.ColumnNames.BoxNo, esSystemType.String); }
		} 
		
		public esQueryItem BoxYear
		{
			get { return new esQueryItem(this, VBoxLabelInfoMetadata.ColumnNames.BoxYear, esSystemType.Int32); }
		} 
		
		public esQueryItem BoxMonth
		{
			get { return new esQueryItem(this, VBoxLabelInfoMetadata.ColumnNames.BoxMonth, esSystemType.Int32); }
		} 
		
		public esQueryItem Dept
		{
			get { return new esQueryItem(this, VBoxLabelInfoMetadata.ColumnNames.Dept, esSystemType.String); }
		} 
		
		public esQueryItem LegalEntity
		{
			get { return new esQueryItem(this, VBoxLabelInfoMetadata.ColumnNames.LegalEntity, esSystemType.String); }
		} 
		
		public esQueryItem DocType
		{
			get { return new esQueryItem(this, VBoxLabelInfoMetadata.ColumnNames.DocType, esSystemType.String); }
		} 
		
		public esQueryItem BoxID
		{
			get { return new esQueryItem(this, VBoxLabelInfoMetadata.ColumnNames.BoxID, esSystemType.Decimal); }
		} 
		
		public esQueryItem DocNoMax
		{
			get { return new esQueryItem(this, VBoxLabelInfoMetadata.ColumnNames.DocNoMax, esSystemType.String); }
		} 
		
		public esQueryItem DocNoMin
		{
			get { return new esQueryItem(this, VBoxLabelInfoMetadata.ColumnNames.DocNoMin, esSystemType.String); }
		} 
		
		public esQueryItem PostDate
		{
			get { return new esQueryItem(this, VBoxLabelInfoMetadata.ColumnNames.PostDate, esSystemType.DateTime); }
		} 
		
		#endregion
		
	}



	[Serializable]
	public partial class VBoxLabelInfoMetadata : esMetadata, IMetadata
	{
		#region Protected Constructor
		protected VBoxLabelInfoMetadata()
		{
			m_columns = new esColumnMetadataCollection();
			esColumnMetadata c;

			c = new esColumnMetadata(VBoxLabelInfoMetadata.ColumnNames.BoxNo, 0, typeof(System.String), esSystemType.String);
			c.PropertyName = VBoxLabelInfoMetadata.PropertyNames.BoxNo;
			c.CharacterMaxLength = 20;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(VBoxLabelInfoMetadata.ColumnNames.BoxYear, 1, typeof(System.Int32), esSystemType.Int32);
			c.PropertyName = VBoxLabelInfoMetadata.PropertyNames.BoxYear;
			c.NumericPrecision = 10;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(VBoxLabelInfoMetadata.ColumnNames.BoxMonth, 2, typeof(System.Int32), esSystemType.Int32);
			c.PropertyName = VBoxLabelInfoMetadata.PropertyNames.BoxMonth;
			c.NumericPrecision = 10;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(VBoxLabelInfoMetadata.ColumnNames.Dept, 3, typeof(System.String), esSystemType.String);
			c.PropertyName = VBoxLabelInfoMetadata.PropertyNames.Dept;
			c.CharacterMaxLength = 50;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(VBoxLabelInfoMetadata.ColumnNames.LegalEntity, 4, typeof(System.String), esSystemType.String);
			c.PropertyName = VBoxLabelInfoMetadata.PropertyNames.LegalEntity;
			c.CharacterMaxLength = 50;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(VBoxLabelInfoMetadata.ColumnNames.DocType, 5, typeof(System.String), esSystemType.String);
			c.PropertyName = VBoxLabelInfoMetadata.PropertyNames.DocType;
			c.CharacterMaxLength = 50;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(VBoxLabelInfoMetadata.ColumnNames.BoxID, 6, typeof(System.Decimal), esSystemType.Decimal);
			c.PropertyName = VBoxLabelInfoMetadata.PropertyNames.BoxID;
			c.NumericPrecision = 18;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(VBoxLabelInfoMetadata.ColumnNames.DocNoMax, 7, typeof(System.String), esSystemType.String);
			c.PropertyName = VBoxLabelInfoMetadata.PropertyNames.DocNoMax;
			c.CharacterMaxLength = 40;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(VBoxLabelInfoMetadata.ColumnNames.DocNoMin, 8, typeof(System.String), esSystemType.String);
			c.PropertyName = VBoxLabelInfoMetadata.PropertyNames.DocNoMin;
			c.CharacterMaxLength = 40;
			c.IsNullable = true;
			m_columns.Add(c);
				
			c = new esColumnMetadata(VBoxLabelInfoMetadata.ColumnNames.PostDate, 9, typeof(System.DateTime), esSystemType.DateTime);
			c.PropertyName = VBoxLabelInfoMetadata.PropertyNames.PostDate;
			c.IsNullable = true;
			m_columns.Add(c);
				
		}
		#endregion	
	
		static public VBoxLabelInfoMetadata Meta()
		{
			return meta;
		}	
		
		public Guid DataID
		{
			get { return base.m_dataID; }
		}	
		
		public bool MultiProviderMode
		{
			get { return false; }
		}		

		public esColumnMetadataCollection Columns
		{
			get	{ return base.m_columns; }
		}
		
		#region ColumnNames
		public class ColumnNames
		{ 
			 public const string BoxNo = "BoxNo";
			 public const string BoxYear = "BoxYear";
			 public const string BoxMonth = "BoxMonth";
			 public const string Dept = "Dept";
			 public const string LegalEntity = "LegalEntity";
			 public const string DocType = "DocType";
			 public const string BoxID = "BoxID";
			 public const string DocNoMax = "DocNoMax";
			 public const string DocNoMin = "DocNoMin";
			 public const string PostDate = "PostDate";
		}
		#endregion	
		
		#region PropertyNames
		public class PropertyNames
		{ 
			 public const string BoxNo = "BoxNo";
			 public const string BoxYear = "BoxYear";
			 public const string BoxMonth = "BoxMonth";
			 public const string Dept = "Dept";
			 public const string LegalEntity = "LegalEntity";
			 public const string DocType = "DocType";
			 public const string BoxID = "BoxID";
			 public const string DocNoMax = "DocNoMax";
			 public const string DocNoMin = "DocNoMin";
			 public const string PostDate = "PostDate";
		}
		#endregion	

		public esProviderSpecificMetadata GetProviderMetadata(string mapName)
		{
			MapToMeta mapMethod = mapDelegates[mapName];

			if (mapMethod != null)
				return mapMethod(mapName);
			else
				return null;
		}
		
		#region MAP esDefault
		
		static private int RegisterDelegateesDefault()
		{
			// This is only executed once per the life of the application
			lock (typeof(VBoxLabelInfoMetadata))
			{
				if(VBoxLabelInfoMetadata.mapDelegates == null)
				{
					VBoxLabelInfoMetadata.mapDelegates = new Dictionary<string,MapToMeta>();
				}
				
				if (VBoxLabelInfoMetadata.meta == null)
				{
					VBoxLabelInfoMetadata.meta = new VBoxLabelInfoMetadata();
				}
				
				MapToMeta mapMethod = new MapToMeta(meta.esDefault);
				mapDelegates.Add("esDefault", mapMethod);
				mapMethod("esDefault");
			}
			return 0;
		}			

		private esProviderSpecificMetadata esDefault(string mapName)
		{
			if(!m_providerMetadataMaps.ContainsKey(mapName))
			{
				esProviderSpecificMetadata meta = new esProviderSpecificMetadata();			


				meta.AddTypeMap("BoxNo", new esTypeMap("nvarchar", "System.String"));
				meta.AddTypeMap("BoxYear", new esTypeMap("int", "System.Int32"));
				meta.AddTypeMap("BoxMonth", new esTypeMap("int", "System.Int32"));
				meta.AddTypeMap("Dept", new esTypeMap("varchar", "System.String"));
				meta.AddTypeMap("LegalEntity", new esTypeMap("varchar", "System.String"));
				meta.AddTypeMap("DocType", new esTypeMap("varchar", "System.String"));
				meta.AddTypeMap("BoxID", new esTypeMap("numeric", "System.Decimal"));
				meta.AddTypeMap("DocNoMax", new esTypeMap("nvarchar", "System.String"));
				meta.AddTypeMap("DocNoMin", new esTypeMap("nvarchar", "System.String"));
				meta.AddTypeMap("PostDate", new esTypeMap("datetime", "System.DateTime"));			
				
				
				
				meta.Source = "V_BoxLabelInfo";
				meta.Destination = "V_BoxLabelInfo";
				
				meta.spInsert = "proc_V_BoxLabelInfoInsert";				
				meta.spUpdate = "proc_V_BoxLabelInfoUpdate";		
				meta.spDelete = "proc_V_BoxLabelInfoDelete";
				meta.spLoadAll = "proc_V_BoxLabelInfoLoadAll";
				meta.spLoadByPrimaryKey = "proc_V_BoxLabelInfoLoadByPrimaryKey";
				
				this.m_providerMetadataMaps["esDefault"] = meta;
			}
			
			return this.m_providerMetadataMaps["esDefault"];
		}

		#endregion

		static private VBoxLabelInfoMetadata meta;
		static protected Dictionary<string, MapToMeta> mapDelegates;
		static private int _esDefault = RegisterDelegateesDefault();
	}
}
